﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Web.Security;

public partial class sessionTimeout1 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

        // This is to restore the user and user type to the session
        if (this.Request.Cookies["cookUser"] != null && this.Request.Cookies["cookUserType"] != null)
        {
            this.Session["user"] = this.Request.Cookies["cookUser"].Value;
            this.Session["userType"] = this.Request.Cookies["cookUserType"].Value;
        }
        else
        {
            Session.Abandon();
            FormsAuthentication.SignOut();
        }
    }
}
